using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace LogNet6.SqlServer.Demo.Pages.Log
{
    public class IndexModel : PageModel
    {
        [BindProperty(SupportsGet = true)]
        public int PageNo { get; set; } = 0;
        [BindProperty(SupportsGet = true)]
        public int PageSize { get; set; } = 10;

        public List<SqlserverLoggerItem> Items { get; set; } = default!;
        public void OnGet([FromServices] ISqlServerLoggerProcessor service)
        {
            Items=service.GetLogs(PageNo, PageSize);
        }
    }
}
